function Bullet(def) {
	this.x = def.spawnX / SCALE;
	this.y = def.spawnY / SCALE;
	this.z = def.spawnZ;
	this.speed = 0.5;
	this.heading = new box2d.b2Vec2(def.dirX,def.dirY);
	
	//this.origin = weapon;
	
	this.setupView();
	this.setupPhysics();
}

Bullet.prototype = {
	
	setupView: function() {
		
	},
	
	setupPhysics: function() {
		
	},
	
	update: function() {
		//this.x = this.playerBody.GetWorldCenter().x * SCALE;
		//this.y = this.playerBody.GetWorldCenter().y * SCALE;
		
		if(this.bulletList.length > 10) {
			var bullet = this.bulletList[0];
			this.bulletList.splice(0,1);
			world.DestroyBody(bullet);
			document.getElementById('debug').innerHTML = this.bulletList.length;
		}
		
		// keep the image on top of the box2d object
		this.playerImage.x = this.x - this.width - 15;
		this.playerImage.y = this.y - this.height - 5;
	}
}
